package com.cyy.cn.mq;


import com.cyy.cn.Application;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * rabbit生产者
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class MqTest {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Test
    public void testSend(){

        rabbitTemplate.convertAndSend("chenyuyi","测试一下消息发送");
    }

    @Test
    public void testSendFaout(){
        rabbitTemplate.convertAndSend("shicifang","","试一下分列模式");
    }

    @Test
    public void testSendTopic() {
        rabbitTemplate.convertAndSend("topictest","chenyu.hhhh","主题模式测试");
    }


}
